﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace AnesSystem.Controls.CommonTables.GX.DLXRMYY
{
    /// <summary>
    /// ShuQiangFangDanCtrl.xaml 的交互逻辑
    /// </summary>
    public partial class ShuQiangFangDanCtrl : CustomCommonTableCtrl
    {
        public ShuQiangFangDanCtrl()
        {
            InitializeComponent();
            IniteRadioBation();
            getDefaltTime();
        }
        private void IniteRadioBation()
        {
            new RadioButtonHelper().ChangeRadioSatus(szqx, szss, szhm, szhs);
            new RadioButtonHelper().ChangeRadioSatus(hxkn_y, hxkn_n);
            new RadioButtonHelper().ChangeRadioSatus(zg_y, zg_n);
            new RadioButtonHelper().ChangeRadioSatus(kkd_zc, kkd_yc);
            new RadioButtonHelper().ChangeRadioSatus(jyy, jyw);
            new RadioButtonHelper().ChangeRadioSatus(sqfs6, sqfsf6);
            new RadioButtonHelper().ChangeRadioSatus(sqfs7, sqfsf7);
            new RadioButtonHelper().ChangeRadioSatus(cgkny, cgkn);
            new RadioButtonHelper().ChangeRadioSatus(jzjxy, jzjxw, jzjsqc);
            new RadioButtonHelper().ChangeRadioSatus(ccdy, ccdw);
            new RadioButtonHelper().ChangeRadioSatus(sxzydzc, sxzydyc);
            new RadioButtonHelper().ChangeRadioSatus(xuecg_zc, xuecg_yc);
            new RadioButtonHelper().ChangeRadioSatus(xiongt_zc, xiongt_yc);
            new RadioButtonHelper().ChangeRadioSatus(ncg_yc, ncg_zc);
            new RadioButtonHelper().ChangeRadioSatus(sqfs12, sqfsf12);
            new RadioButtonHelper().ChangeRadioSatus(ecg_zc, ecg_yc);
            new RadioButtonHelper().ChangeRadioSatus(fxiongt_zc, fxiongt_yc);
            new RadioButtonHelper().ChangeRadioSatus(gangn_zc, gangn_yc);
            new RadioButtonHelper().ChangeRadioSatus(shengd_zc, shengd_yc);
            new RadioButtonHelper().ChangeRadioSatus(ningxgn_zc, ningxgn_yc);
            new RadioButtonHelper().ChangeRadioSatus(dianjz_zc, dianjz_yc);
            new RadioButtonHelper().ChangeRadioSatus(yl,el,sal,sil,wl);
            new RadioButtonHelper().ChangeRadioSatus(syz_y, syz_w);
            new RadioButtonHelper().ChangeRadioSatus( sqfs13, sqfsf13);
            new RadioButtonHelper().ChangeRadioSatus( sqfs14, sqfsf14);
            new RadioButtonHelper().ChangeRadioSatus(xgn1, xgn2, xgn3, xgn4);
            new RadioButtonHelper().ChangeRadioSatus(asa1, asa2, asa3, asa4, asa5, asa6);
            new RadioButtonHelper().ChangeRadioSatus(aq, yq);
            

        }

        private void getDefaltTime()
        {
            if (string.IsNullOrEmpty(rqn2.Value.ToString()))
            {
                rqn2.Value = DateTime.Now.Year;
                rqy2.Value = DateTime.Now.Month;
                rqr2.Value = DateTime.Now.Day;
            }
        }
        private void rq_GotFocus(object sender, RoutedEventArgs e)
        {
            CusDatePickerWin cusDatePicker = new CusDatePickerWin();
            cusDatePicker.SelectedDateTime = DateTime.Now;
            cusDatePicker.ShowDialog();
            
            if (cusDatePicker.Result)
            {
                rqn2.Value = cusDatePicker.SelectedDateTime.Year;
                rqy2.Value = cusDatePicker.SelectedDateTime.Month;
                rqr2.Value = cusDatePicker.SelectedDateTime.Day;
                //rq2.Value = cusDatePicker.SelectedDateTime.ToString(DateFormat.DATE_FORMAT_STR_YMDHM_CN);//xxxx年xx月xx日
            }
        }
    }
}
